<!--
Copyright (C) 2016, BMW Car IT GmbH

Author: Sebastian Mattheis <sebastian.mattheis@bmw-carit.de>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in
writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
-->

<!DOCTYPE html>
<html>
<head>
<title>Barefoot Monitor (Messages)</title>
<style>
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font: 13px Helvetica, Arial;
}

form {
	background: #000;
	padding: 3px;
	position: fixed;
	bottom: 0;
	width: 100%;
}

form input {
	border: 0;
	padding: 10px;
	width: 90%;
	margin-right: .5%;
}

form button {
	width: 9%;
	background: rgb(130, 224, 255);
	border: none;
	padding: 10px;
}

#messages {
	list-style-type: none;
	margin: 0;
	padding: 0;
}

#messages li {
	padding: 5px 10px;
}

#messages li:nth-child(odd) {
	background: #eee;
}
</style>
</head>
<body>
	<ul id="messages"></ul>
	<script src="/socket.io/socket.io.js"></script>
	<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
	<script>
            var socket = io();
            socket.on('message', function(msg){
                $('#messages').append($('<li>').text(JSON.stringify(msg)));
            })
        </script>
</body>
</html>
